package com.hoshiibuy.sys.permission.entity.param;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiibuy.common.query.CommonParam;
import com.hoshiibuy.sys.permission.entity.SysModels;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 查询表述系统平台功能参数
 * </p>
 * 
 * @author Mr.Wu
 * @since 2019-04-27
 */
@Data
public class SysModelsQueryParam extends CommonParam implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@ApiModelProperty(value = "id")
	private Long id;

	/**
	 * 编号
	 */
	@ApiModelProperty(value = "编号")
	private String code;

	/**
	 * 上级功能
	 */
	@ApiModelProperty(value = "上级功能")
	private Long parentid;

	/**
	 * 类别
	 */
	@ApiModelProperty(value = "类别")
	private String type;

	/**
	 * 系统名称
	 */
	@ApiModelProperty(value = "系统名称")
	private String name;

	/**
	 * 系统标题
	 */
	@ApiModelProperty(value = "系统标题")
	private String title;

	/**
	 * 系统描述
	 */
	@ApiModelProperty(value = "系统描述")
	private String description;

	/**
	 * 排序
	 */
	@ApiModelProperty(value = "排序")
	private Long orders;

	/**
	 * 是否可用 0-不可用 1-可用
	 */
	@ApiModelProperty(value = "是否可用 0-不可用 1-可用")
	private Integer enabled;

	public QueryWrapper<SysModels> getQueryWrapper() {
		QueryWrapper<SysModels> queryWrapper = new QueryWrapper<SysModels>();
		queryWrapper.eq(this.id != null, "id", this.id);
		queryWrapper.eq(StringUtils.isNotBlank(this.code), "code", this.code);
		queryWrapper.eq(this.parentid != null, "parentid", this.parentid);
		queryWrapper.eq(StringUtils.isNotBlank(this.type), "type", this.type);
		queryWrapper.eq(StringUtils.isNotBlank(this.name), "name", this.name);
		queryWrapper.eq(StringUtils.isNotBlank(this.title), "title", this.title);
		queryWrapper.eq(StringUtils.isNotBlank(this.description), "description", this.description);
		queryWrapper.eq(this.orders != null, "orders", this.orders);
		queryWrapper.eq(this.enabled != null, "enabled", this.enabled);
		return queryWrapper;
	}
}
